Object.defineProperty(exports, "__esModule", {
    value: !0
});

var A = function(A) {
    return A && A.__esModule ? A : {
        default: A
    };
}(require("../component"));

exports.default = {
    setDefaults: function() {
        return {
            className: void 0,
            icon: "",
            title: void 0,
            text: void 0,
            buttons: [],
            buttonClicked: function() {}
        };
    },
    init: function(t) {
        var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, i = Object.assign({}, this.setDefaults(), e), n = new A.default({
            scope: "$wux.prompt." + t,
            data: i,
            methods: {
                hide: function() {
                    this.setHidden();
                },
                show: function() {
                    this.setVisible();
                },
                buttonClicked: function(A) {
                    var t = A.currentTarget.dataset.index;
                    "function" == typeof i.buttonClicked && i.buttonClicked(t, i.buttons[t]);
                }
            }
        });
        return {
            show: n.show,
            hide: n.hide
        };
    }
};